#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableAutoChessSeasionTitleDao:DaoBase<TableAutoChessSeasionTitle>
    {
        public override string GetFileName()
        {
            return "TableAutoChessSeasionTitle.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableAutoChessSeasionTitle>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableAutoChessSeasionTitle model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.seasonTitleId)) UnityEngine.Debug.LogError("数据表id重复:TableAutoChessSeasionTitle->id: " + model.seasonTitleId);
            #endif
            cachePrimaryInt[model.seasonTitleId] = model;
        }
        protected override TableAutoChessSeasionTitle ParseRowData(string[] rowData)
        {
            TableAutoChessSeasionTitle data = new TableAutoChessSeasionTitle();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.seasonTitleId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.titleRank = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.titleIcon = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.titleRankStart = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.titleRankEnd = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.isSpecialTitle = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.specialTitleIcon = rowData[6];
            }
            return data;
        }
    }
}
